package com.zhoug.router3demo.ui;

import android.os.Bundle;
import android.widget.Button;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.zhoug.router3.Router;
import com.zhoug.router3demo.App;
import com.zhoug.router3demo.Paths;
import com.zhoug.router3demo.R;

/**
 * @Author: zhoug
 * @Date: 2025-01-21
 * @Description:
 */
@Route(path = Paths.LoginActivity)
public class LoginActivity extends MyBaseActivity {
    private Button mBtnLogin;
    private Bundle targetArgs;
    private String targetPath;


    @Override
    protected int getLayoutResId() {
        return R.layout.activity_login;
    }

    @Override
    protected void findViews() {

        mBtnLogin = findViewById(R.id.btnLogin);
    }

    @Override
    protected void onCreate1(Bundle savedInstanceState) {
        Bundle extras = getIntent().getExtras();
        if (null != extras) {
            targetArgs = extras.getBundle("targetArgs");
            targetPath = extras.getString("targetPath");
        }
        mBtnLogin.setOnClickListener(v -> {
            App.setLogin(true);
            Router.getARouter().build(targetPath).with(targetArgs).navigation();
        });
    }

}
